<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<%@ include file="/common/hallimport.jsp" %>
<link href="${ctx}/css/hall.css" rel="stylesheet">
<link href="${ctx}/css/web_style.css" rel="stylesheet">
<script src="${ctx}/js/web/tab.js"></script>
<script src="${ctx}/js/layer/layer.js"></script>
<script src="${ctx}/js/web/jquery.flexslider-min.js"></script>
<link href="${ctx}/js/scroll/scroll.css" rel="stylesheet">
<script type="text/javascript" src="${ctx}/js/scroll/koala.min.1.5.js"></script>
<title>标的竞价现场-竞价大厅</title>
</head>
<body>
<%@ include file="/common/halltop.jsp" %>
<div class="main main_fixed">
<!-- session信息显示 开始 -->
    <c:if test="${!empty session }">
      <div id="sessionDesc" style="display: block" >
      <div class="left">      
	      <div class="xm_box">
	        <div class="xm_boxl fl"> <img src="${session.picUrl}"/> </div>
	        <div class="xm_boxr fr">
	          <h1 class="xm_title" title="${session.sessionName}">${fn:substring(session.sessionName,0,20)}</h1>
	          <table cellpadding="0" cellspacing="0" border="0" class="xm_table">
	            <tr>
	              <td colspan="2" class="td_btop">竞价方式：<span class="red"><script>document.write(bidModeText(${session.sessionMode}))</script></span></td>
	            </tr>
	             <tr>
	              <td>竞价开始时间：<span class="tx_three">${session.openTime}</span></td>
	              <td>${thisTxt}状态：<span class="tx_three"><script>document.write(itemStatusTxt(${session.status}))</script></span></td>
	            </tr>
	            <tr>
	              <td class="padb10" colspan="2"><p>${pub.infoDesc}</p></td>
	            </tr>	           
	          </table>
	        </div>
	      </div>
      </div>
      <div style="display: block" class="session_notice right"> 
      <h5 class="xmcj_title"><span></span> 报名须知</h5>
      <c:if test="${empty apply }">
      	<c:if test="${session.sessionType=='3' }">
      		请选择标的后，针对标的进行申请！
      	</c:if>
      	<c:if test="${session.sessionType!='3' }">
      		<a id="apply_session" onclick="applySession()">申请竞价</a>
      	</c:if>
      </c:if>
      <c:if test="${!empty apply }">
      	<c:if test="${apply.status=='1' }">
      		你的竞价资格已确认！
      	</c:if>
      	<c:if test="${apply.status=='0' }">
      		你的竞价资格待确认！
      	</c:if>
      </c:if>
      </div>
      </div>
    </c:if>
  <!-- session信息显示 结束 -->  
  <!-- hall信息显示 开始 -->  
    <div id="hall" style="display:none">
     <div class="left">
     <!-- 加价开始 -->
     <div class="xm_box">
        <div class="xm_boxl fl"> 
			<div class="flexslider">
	 			<div id="fsD1" class="focus">  
				    <div id="D1pic1" class="fPic">  
				    	<!-- 图片动态加载区 -->
				    </div>
				    <div class="fbg">  
						<div class="D1fBt" id="D1fBt">
							<!-- 原点加载区 -->
						</div>  
				    </div>  
				    <span class="prev"></span>   
				    <span class="next"></span>  
				 </div>
		    </div>
        </div>
        <div class="xm_boxr fr">
          <h1 class="xm_title" id="itemName" title="${item.itemName }">${fn:substring(item.itemName,0,20)}</h1>
          <h3 class="item_line">
          	竞价方式：<span id="bidMode" class="mar20px"><script>document.write(bidModeText('${bidMode }'))</script></span> 
          	所属活动：<span id="sessionName" title="${session.sessionName }"><a onclick="openSession()">${fn:substring(session.sessionName,0,10)}</a></span></h3>
          <h3 class="item_line">
          	<c:if test="${bidMode=='1' || bidMode=='2'}">当前价<c:if test="${item.priceFlag == '1'}">（单价）</c:if>：<span onmouseover="showTips(this,'lastValue')" class="highprice" id="lastValue"></span> <span id="item_priceUnit">${item.priceUnit}/<script>document.write(strUtil.currency('${item.currency}'))</script></span> （<span id="bidTimes" class="red"></span>次报价）</c:if>
            <span class="szq" id="itemStatus"></span>
          </h3>
          <!-- <table cellpadding="0" cellspacing="0" border="0" class="xm_table">
            <tr>
              <td colspan="2" class="padb10">
                  <c:if test="${bidMode=='1' || bidMode=='2'}">当前价：<span class="highprice" id="lastValue"></span> 元 （<span id="bidTimes" class="red"></span>次报价）</c:if>
                  <span class="szq" id="itemStatus"></span>
              </td>
            </tr>
            <tr>
              <td width="52%" class="td_btop">报价人：<span class="tx_three" id="lastUser"></span></td>
              <td width="48%" class="td_btop">报价时间：<span class="tx_three" id="lastBidTime"></span></td>
            </tr>            
            </table>-->
          <!-- 竞价状态开始 -->
          <div class="bid_mode">
	      <c:if test="${bidMode== '7'}">
	      		<div id="status_A" style="display:none;">
	      			竞价未开始!
	      		</div>
	      		<div id="status_BC" style="display:none;">
	      			<a id="btnAllowFirst" class="button" onclick="yingJia();">应价</a>
	      		</div>
	      		<div id="status_Z" style="display:none;">
	      			竞价結果處理中
	      		</div>
	      		<div id="status_9" style="display:none;">
	      			竞价结束
	      		</div>
	      	</c:if>
	      	<c:if test="${bidMode!= '7'}">
	      		<c:if test="${empty apply }">
		          <div id="apply_item">
		          	您尚未申请竞价!<!--<a  onclick="applyItem('${sessionType}')" class="applybtn">申请竞价</a>-->
					<a  onclick="applyItem();" class="applybtn">申请竞价</a>
		          </div>
	          	</c:if>
	          	 <div id="status_3" style="display:none;">
	      			暂停中...
	      		</div>
	      	     <div id="status_A" style="display:none;">
	      			竞价未开始!
	      		</div>
	        <div id="status_BC" style="display:none;">
	          	<div id="div_btn_list" class="price"> 
	          		<font onclick="dec()">-</font><input type=text id="myPrice" readonly="readonly" value="${item.firstValuePre}" style="width:160px;"><font onclick="add()">+</font>
	          		<c:if test="${bidMode=='5'||bidMode=='6'}">
		          	<span style="float:left;">份数：</span><input size="3" type=text id="bidNum" value="" name="bidNum">
		          	</c:if>
	          		<a class="button2" onclick="baojia($('#myPrice').val());">报价</a> 
	            </div>
	          	<c:if test="${bidMode== '1' || bidMode== '2'}"> <a id="btnAllowFirst" class="button fm20px" onclick="baojiaFirst();">起始价</a> 
	          	<a id="btnoncevalue" style="display:none;" class="button_green" onclick="addPrice('A');" title="一口价：￥${item.oncevalue}">一口价</a> <a id="btnifRight" style="display:none;" class="button fm20px" onclick="addPrice(0);">我要行权</a> </c:if>
	         	<c:if test="${bidMode=='3'||bidMode=='4'  }">
	            	<div id="hasbaojia">您已报过价了，不能再报价</div>
	            	<div id="my_table" class="myprice">我上次的报价：<span id="myBaojia"></span>， 报价时间:<span id="myBaojiaTime"></span></div>
	         	 </c:if>
	        </div>
	        <div id="status_D" style="display:none;" class="addprice">
					<center id="status_D_1" style="margin:10px;">
						加价：<input id="addPrice" name="addPrice" /> 
						<a id="btnAddPrice" onclick="baojiaAdd();" class="button3">加价</a>
					</center>
					<center id="status_D_2" style="margin:10px;">最高报价人正在加价过程...</center>
			</div>
	        <div id="status_E" style="display:none;">
	          <center id="status_E_1">
	            <a id="btnAddPrice" class="button_red" onclick="xingquan('T');">我要行权</a>  <!--  <a id="btnAddPrice" class="button_green" onclick="xingquan('F');">放弃行权</a> -->
	          </center>
	          <center id="status_E_2">
	           		 行权人正在行权过程...
	          </center>
	        </div>
	        <div id="status_Z" style="display:none;"> 正在处理报价结果 </div>
	        <div id="status_9" style="display:none;">
	          <div id="status_9_1">恭喜你！您已是最高报价人</div>
	          <div id="status_9_2">报价已结束！
	          <c:if test="${bidMode=='5'||bidMode=='6'}"><a onclick="viewBaojiaList();" class="applybtn">查看竞得结果</a></c:if>
	          </div>
	          <div id="status_9_3">本标的报价已结束，下个标的${session.restTime}分钟后开始</div>
	        </div>
	       </c:if> 
	      <!-- 一次正向/反向报价 --> 
	      </div>
          <!-- 竞价状态结束 -->
          <table cellpadding="0" cellspacing="0" border="0" class="xm_table">
            <tr>
              <td>起始价格：<span class="red" id="firstValue" onmouseover="showTips(this,'firstValue')">${item.firstValuePre }</span> ${item.priceUnit}</td>
              <td>加价幅度：<span class="tx_three" id="increment"></span> ${item.priceUnit}</td>
            </tr>
            <tr>
              <td>开始时间：<span id="item_opentimePre"><c:if test="${fn:contains(item.openTimePre,'2050-12')}">待定</c:if><c:if test="!${fn:contains(item.openTimePre,'2050-12')}">${item.openTimePre }</c:if></span></td>
              <td>限时报价结束时间：<span id="item_closeTimePre"><c:if test="${fn:contains(item.openTimePre,'2050-12')}">待定</c:if><c:if test="!${fn:contains(item.closeTimePre,'2050-12')}">${item.closeTimePre }</c:if></span></td>
            </tr>
          </table>
        </div>
      </div>
     <!-- 加价结束 -->    
      </div>
      <div class="right">
      <div class="sparetime">剩余：<em id="spareTime" ></em></div>
       <!-- 报价记录开始--> 
       <!-- <h5 class="xmcj_title"><span></span> 出价记录</h5> -->
      <table cellpadding="0" cellspacing="0" border="0" class="xmcj_table" id="info_table">
	      <tr>
	        <th>报价人</th>
	        <th>报价价格</th>
	        <th>报价时间</th>
	      </tr>
	    </table>
	    <script type="text/template" id="info_html">
			<? for ( var i = 0; i < rows.length; i++) {?>
			<tr>
			<td>
				<?var userStr = "";?>				
				<?if(rows[i].userName =="${loginUser.userEname}" ){?>	
					<?userStr = "我的报价";?>		
				<?}else{?>				
					<?var reg = /^(.).+(.)$/g;?>
					<?userStr = (rows[i].userName).replace(reg, "$1***$2");?>
				<?}?>				
				<?=userStr?>
			</td>
			<td><span id="bival_<?=i?>" onmouseover="showTips(this,'bival_<?=i?>')"><?=rows[i].bidValue?></span></td>
			<td><?=rows[i].bidTime.substring(0,19)?></td>
			</tr>
			<?}?>  		
	 	</script> 
	    <!-- 报价记录结束 --> 
     </div>
      <!--项目tab start-->
      <div class="pro_tab">
        <ul id="tab">
          <li class="cur">保证金要求</li>
          <li onclick="initApplyContentList()">${thisTxt}公告与须知</li>
           <c:if test="${!empty pub.ztUrl }">
          <li>${thisTxt}活动专题</li>
          </c:if>
          <li>${thisTxt}已结束标的</li>
        </ul>
      </div>
      <div id="con">
        <ul>
          <table  class="info" cellspacing="1" cellpadding="0">
     		<tr>
     			<th style="width: 150px;">竞买申请审核要求</th>
     			<td>
     			<c:if test="${'1'==pub.auditLevel}">不需要审核，直接交纳保证金</c:if>
     			<c:if test="${'2'==pub.auditLevel}">需要审核，资格通过后交纳保证金</c:if>
     			</td>
     		</tr>
     		<tr>
     			<th>是否需要上传电子资料</th>
     			<td>
     				<c:if test="${'F'==pub.ifUpload}">【不需要上传】</c:if>
     				<c:if test="${'T'==pub.ifUpload}">【需要上传】
     					${pub.uploadDesc}
     				</c:if>
     			</td>
     		</tr>
     		<tr>
     			<th>概要介绍</th><td>${pub.infoDesc}</td>
     		</tr>
        </table>
        </ul>
        <ul style="display:none;">
        <form id="content_notice_form">
         <input type=hidden name="objId" id="content_objId">
         <input type=hidden name="objType" id="content_objType">
         <input type=hidden name="methodKey" value="contentList">
         <input type=hidden name="tag" value="div">
        </form>
         <div id="content_notice_div"></div>
     		<script type="text/template" id="content_notice_div_html">
				<ul>
	     		<? for ( var i = 0; i < rows.length; i++) {?>
                	<li><span id='content_<?=rows[i].infoId?>'>【<?=rows[i].contentType?>】<a href="/admin/hall/content/<?=rows[i].infoId?>"><?=rows[i].title?></a></span></li>
				<?}?> 
				</ul>		
			</script>
        </ul>
        
        <ul style="display:none;">
          <c:if test="${!empty pub.ztUrl }">
             <iframe scrolling="auto" frameborder="0"  src="${pub.ztUrl}" style="width:100%;height:300px;"></iframe>
          </c:if>
        </ul>
        
        <ul style="display:none;">
         <div class="searchForm">
          <form id="endList_form">
            <input type="hidden" name="page"  value="1">
            <input type="hidden" name="rows"  value="9">
            <input type="hidden" name="methodKey"  value="itemHistoryList">
            <input type="hidden" name="sessionId"  value="${session.sessionId}">
            <input type="hidden" name="direction"  value="T">
            <input type="hidden" name="tag"  value="table">
            <input type="text" placeholder="标的名称" tip="标的名称" value="" name="itemName">
            <a onclick="endListSearch()"  class="searchbtn">查询</a>
          </form>
        </div>
        <div id="endList_div" class="" cellspacing="1" cellpadding="0">
        </div>
        	<div class="flcon" id="flcon">
			 <table id="endList_table" class="tb_list" cellspacing="1" cellpadding="0">
				<tr class='active' id="title2" >
					<th style="width:200px;">标的名称</th>
					<th>竞价方式</th>
					<th>起始价格 （万元）</th>
					<th>报价次数</th>
					<th>最高报价（万元）</th>
					<th>溢价率（%）</th>
					<th>开始时间</th>	
					<th>结束时间</th>
				</tr>
			</table>
			</div>
			<div id="endList_page" class="web_pages"></div>
			<script type="text/template" id="endList_table_html">
				<? for ( var i = 0; i < rows.length; i++) {?>
					<tr id=item_<?=rows[i].itemId?>>
						<td class="td_left pl5px" title="<?=rows[i].itemName?>"><?=strUtil.subStr(rows[i].itemName,10)?></td>
						<td><?=bidModeText(rows[i].bidMode)?></td>
						<td class="td_right">&yen;<?=rows[i].firstValue?></td>
						<td class="td_right"><a href="javascript:void(0)" onclick="itemInfoList('<?=rows[i].itemId?>','<?=rows[i].itemName?>')"><?=rows[i].bidTimes?></a></td>
						<td class="td_right">&yen;<?=rows[i].lastValue?></td>
						<td class="td_right"><?=(rows[i].yjl*100).toFixed(2)?>%</td>
						<td><?=rows[i].openTime?></td>
						<td><?=rows[i].closeTime?></td>
					</tr>
				<?}?>  		
			</script>
        </ul>
      </div>
      <!--项目tab end--> 
  </div> 
  <!-- hall信息显示 结束 -->
  </div>
  <!-- float div start-->
  <div class="float_main" id="float_main">
    <div class="flmain_l fl">
      <p><span></span></p>
    </div>
    <div class="flmain_m"> 
      <!---input start-->
      <div class="flcon" id="flcon">
         <form id="runningList_form">
            <input type="hidden" name="page"  value="1">
            <input type="hidden" name="rows"  value="9">
            <input type="hidden" name="methodKey"  value="itemList">
            <input type="hidden" name="sessionId"  value="${session.sessionId}">
            <input type="hidden" name="direction"  value="T">
            <input type="hidden" id="groupId" name="groupId" value="0">
         </form>
         <div id="group_btn">
             <c:if test="${!empty session.ifGroup && 'T'==session.ifGroup}">
	            <c:forEach var="g" items="${itemGroupList}" varStatus="i">
	             	<span class="gt_box" id="group_${g.groupId}" groupId="${g.groupId}" onclick="setGroupId('${g.groupId}')">${g.groupName} 开始时间：${g.openTime} </span>
	             </c:forEach>
	          </c:if>
	    </div>
        <div id="runningList_div"></div>
        <script type="text/template" id="runningList_div_html">
		<div id="focus">
	     <? for ( var i = 0; i < rows.length; i++) {?>
			<?if(i%8 == 0){?>			
			<ul class="fltext">
			<?}?>
			<li id="itli_<?=rows[i].itemId?>" class="it_box">
				<input type=hidden name=ids value=<?=rows[i].itemId?> >
                <input type=hidden id=incGroup_<?=rows[i].itemId?> value=<?=rows[i].incrementGroup?> >
                <input type=hidden id=incValue_<?=rows[i].itemId?> value=<?=rows[i].incrementValue?> >
				<input type=hidden id=dc_<?=rows[i].itemId?> value=<?=rows[i].decimalCount?> >
			<dl>
              <dt><a onclick="gotohall('<?=rows[i].itemId?>');setImgScroll('<?=rows[i].itemId?>');"><img src="<?=strUtil.doNull(rows[i].picUrl,'${ctx}/images/def.jpg')?>"/></a></dt>
			  <dd>
                <h6><a onclick="gotohall('<?=rows[i].itemId?>');" title="<?=rows[i].itemName?>"><?=strUtil.subStr(rows[i].itemName,8)?></a>（<span id=status_<?=rows[i].itemId?>></span>）</h6>
                <p>当前价：<span class="red" id=value_<?=rows[i].itemId?>></span></p>
                <a class="price_btn" id="quick_<?=rows[i].itemId?>" onclick="quick('<?=rows[i].itemId?>');">报价</a>
              </dd>
            </dl>
			</li>
		<?if(i%8 == 7){?>			
		</ul>
		<?}?>
	   <?}?>  	
		</div>	
	</script> 
      </div>
    </div>
    <div class="flmian_r fr"> <a href="#" class="close"><img src="/images/web/close.png" /></a>
      <p><span></span></p>
    </div>
  </div>
  <!-- float div end-->
</div>
<%@ include file="/common/hallbottom.jsp" %>
<div id="content_notice_bmxzs" style="padding:10px 10px;line-height:30px;">
	<div id="div_content_bmxz" style="display:none">
		<form id="content_apply_form">
         <input type=hidden name="objId" id="contentApply_objId">
         <input type=hidden name="objType" id="contentApply_objType">
         <input type=hidden name="contentType" value="报名须知">
         <input type=hidden name="methodKey" value="contentList">
         <input type=hidden name="tag" value="div">
         <input type=hidden name="htmlFlag" value="T">
         
        </form>
         <div id="content_apply_div"></div>
		<div class="applybtn_div"><div style="float:left">&nbsp;&nbsp;<input type="checkbox" onclick="javascript:ckBoxXz(this,'btntongyi',ifRead);" checked/>已阅读报名须知 </div><a id="btntongyi" style="margin-right:110px;" onclick="submitTo2(ifRead)"> 同  意 </a></div>
	</div>

	<div id="apply_window" class="popbox" style="display:none">
   	<form id="apply_form" name="apply_form" action="">
   		<input type="hidden" name="sessionId" value=""/>
   		<input type="hidden" name="itemId" value=""/>
   		<input type="hidden" name="userId" value="${loginUser.userId}"/>
   		<input type="hidden" name="userName" value="${loginUser.userEname}"/>
   		<input type="hidden" name="realName" value="${loginUser.userCname}"/>
   		<input type="hidden" name="objName" value="${session.sessionName }"/>
   		<table  class="info" cellspacing="1" cellpadding="0">
  		<tr>
  			<th style="width: 150px;">申请人账号</th>
  			<td>${loginUser.userEname}</td>
  		</tr>
  		<tr>
  			<th>申请人名称</th>
  			<td>${loginUser.userCname}</td>
  		</tr>
  		<tr>
  			<th>联系电话</th>
  			<td><input id="apply_phone" name="phone" maxlength="11" class="easyui-validatebox validatebox-text" validtype="tel" value=""/></td>
  		</tr>
  		<tr>
  			<th>手机</th>
  			<td><input id="apply_mobile" name="mobile" maxlength="11" class="easyui-validatebox validatebox-text" validtype="mobile" value=""/></td>
  		</tr>
  		<tr>
  			<th>联系邮箱</th>
  			<td><input id="apply_email" name="email" maxlength="50" class="easyui-validatebox validatebox-text" validtype="email" value=""/></td>
  		</tr>
		<c:if test="${sessionType!='3' }">
			<c:if test="${session.bailCtrl=='2' }">
		  		<tr>
		  			<th>竞买数量</th>
		  			<td><input id="allowBuyNum" name="allowBuyNum" maxlength="50" value=""/></td>
		  		</tr>
		  	</c:if>
		</c:if>
 		</table>
   	</form>
   	<div class="applybtn_div"><a onclick="applySave()">提交申请</a></div>
</div>
<div id="view_baojias_window" class="popbox" style="display:none">
   		<table cellpadding="0" cellspacing="0" border="0" class="tb_list" id="baojias_table">
  		<tr>
  			<th style="width: 140px;">报价人</th>
  			<th style="width: 100px;">竞得份额</th>
  			<th style="width: 280px;">报价价格</th>
  			<th style="width: 180px;">报价时间</th>
  		</tr>
 		</table>
 		<script type="text/template" id="baojias_html">
			<? for ( var i = 0; i < rows.length; i++) {?>
			<tr>
			<td>
				<?var userStr = "";?>				
				<?if(rows[i].userName =="${loginUser.userEname}" ){?>	
					<?userStr = "我的报价";?>		
				<?}else{?>				
					<?var reg = /^(.).+(.)$/g;?>
					<?userStr = (rows[i].userName).replace(reg, "$1***$2");?>
				<?}?>				
				<?=userStr?>
			</td>
            <td class="td_right"><?=rows[i].bidNum?></td>
			<td class="td_right"><?=rows[i].lastValue?><?=$("#item_priceUnit").html()?></td>
			<td><?=rows[i].bidTime.substring(0,19)?></td>
			</tr>
			<?}?>  		
	 	</script> 
</div>
</div>
</body>
</html>
<script type="text/javascript">
var ifread="F";
//初始化加载
$(function(){
	//初始化全局变量
	
	itemId="${itemId}";
	sessionId = "${sessionId}";
	sessionType = "${sessionType}";
	bidMode = "${bidMode}";
	line = "${session.serialCtrl}"==""?"F":"${session.serialCtrl}";
	loginUser = "${loginUser.userEname}";//当前登录人
	myLevel = "${myLevel}";//当前登录人针对此标的的行权级别
	if(itemId!=0){
		decimalCount = "${item.decimalCount}";
		///如果lastValue为空取firstValue;
		firstValue = "${price.firstValue}";
		if(bidMode=="3" ||bidMode=="4" ){
			lastValue = "${price.firstValue}";
		}else{
			lastValue = "${price.lastValue}";//${price.lastValue}==0? ${price.firstValue} : ${price.lastValue};
			if(lastValue=="0"|| lastValue=="")lastValue = "${price.firstValue}";
		}
		incrementGroup ="${item.incrementGroup}";
		incrementValue ="${item.incrementValue}";
		allowFirstValue = "${item.allowFirstValue}";
		increment=getIncrement();
		onceValue ="";
		lastUser = "${price.userName}";//最高报价人
		vFlag = "${item.vFlag}";
		groupId = "${item.groupId}";
		if(groupId!="0"){
			$('#groupId').val(groupId);
			//setGroupCss(groupId);
		}
		<c:if test="${item.oncevalue != '0' }">
	    	$('#btnoncevalue').show();
	    	onceValue ='${item.oncevalue}';
		</c:if>
	}else{
		var firstGroupId = getFirstGroupId();
		groupId = firstGroupId;
		$('#groupId').val(firstGroupId);
		//setGroupCss(firstGroupId);
	}
	<c:if test="${empty apply }">
    $('#btnAllowFirst').hide();
    $('#div_btn_list').hide();	
    $('#hasbaojia').hide();	
	</c:if>
	<c:if test="${!empty session }">
		//加载分页列表
		//runningListSearch();
		hallRunningListSearch();
		//底部层浮动控制
		$(".float_main").animate({bottom:0},20);
		//定期刷新列表中的数据
		setInterval(myLoad,3000);
	</c:if>
	
	if(itemId!="0"){
		$("#hall").show();
		$("#sessionDesc").hide();
		interv = setInterval(bidGet,intervalV);
	}
	
	/**$("#main").tabs({
		onSelect:function(title){
            if("${thisTxt}已结束标的" == title){
            	endListSearch();
            }else if("${thisTxt}公告与须知" == title){
            	
            }
            
		}
	});**/
	//getItemPicAttaList(itemId,"itemPic");
	
	//单独处理报价详情页面tab页面切换
	initTabDetail();
	
	//底部层浮动控制
	//$(".float_main").animate({bottom:0},20);
	
	 // setTimeout(flmain,2000);
	$(".close").click(function(){
		 $(".float_main").animate({bottom:-160});
		})
	var sWidth = 0;
	var len = 0;
	
	
    //标的图切换插件
	setImgScroll(itemId);
});


//add 0512 xhe 此方法两处使用（1：点击标的首次进入，2：快捷切换回调的hall.js中initHallPage方法里
function setImgScroll(id){
	var picHtml = "",picFocHtml = "";
	$.ajax({
		   type:'get',
		   url:ctx+spaceDomain+'hall/itemPic',
		   data:{objId:id},
		   dataType:'json',
		   success: function(myData){
			   //\alert(myData.attaSize);
			   if(myData!=null && myData.attaSize>0){
				   for(var i = 0;i<myData.attaList.length;i++){
					   var obj = myData.attaList[i];
					   var picUrl = obj.downloadUrl+obj.sid+"."+obj.attachmentType;
					   picHtml += "<div class='fcon' style='display: ;'><img src='"+picUrl+"' style='opacity:1;'></div>";
					   picFocHtml += "<a href='javascript:void(0)' hidefocus='true' target='_self'><i>"+(i+1)+"</i></a>";
				   }
			   }else{
				   picHtml = "<div class='fcon' style='display: ;'><img src='${ctx}/images/def.jpg' style='opacity:1;'></div>";
				   picFocHtml = "<a href='javascript:void(0)' hidefocus='true' target='_self'><i>1</i></a>";
				   
			   }
			   $("#D1pic1").html(picHtml);
			   $("#D1fBt").html(picFocHtml);
			   
			 //加载轮播插件
				Qfast.add('widgets', { path: "${ctx}/js/scroll/terminator2.2.min.js", type: "js", requires: ['fx'] });  
				Qfast(false, 'widgets', function () {
					K.tabs({
						id: 'fsD1',   //焦点图包裹id  
						conId: "D1pic1",  //** 大图域包裹id  
						tabId: "D1fBt",  
						tabTn: "a",
						conCn: ".fcon", //** 大图域配置class       
						auto: 1,   //自动播放 1或0
						effect: "fade",   //效果配置
						eType: "click", //** 鼠标事件
						pageBt:true,//是否有按钮切换页码
						bns: [".prev", ".next"],//** 前后按钮配置class                          
						interval: 2000  //** 停顿时间  
					}) 
				});
		  }
	});	
}

//单独控制报价详情页面tab选项卡事件方法
function  initTabDetail()
{
	var itab = document.getElementById("tab").getElementsByTagName("li");
	var icon = document.getElementById("con").getElementsByTagName("ul");
	
	for(var i = 0; i < itab.length; i++)
	{
		itab[i].index = i;
		itab[i].onclick = function ()
		{
			//1.先关闭所有显示层
			for(var i = 0; i < itab.length; i++){
				itab[i].className="";
			    icon[i].style.display = "none";
			}
			//2.控制显示那一层
			this.className = "cur";
			icon[this.index].style.display = "block";
			
			//3.定义显示后要执行方法
			var tabTitle = $(this).text();
			//alert("第["+this.index+"]个的标的是："+tabTitle);
			switch (this.index) {
			case 0:
				break;
			case 1:
				initApplyContentList();//加载公告和须知
				break;
			case 2:
				//加载专题（后续此处要补充？？？？）
				break;
			case 3:
				//加载已结束标的
				endListSearch();
				break;
			default:
				break;
			}
		}	
	}
}

//显示大小金额信息
function showTips(t,id){
	var obj = $(t);
	var htmls=getChinese(obj.text());
	layer.tips(htmls, '#'+id, {tips: 1,time:5000});
}
function showBmxz(sessionType){
	getContentList_bmxz("content_notice_bmxzs","","","报名须知");
	
}

function myCompose(rows){
	var ititle = "";
	var icontent = "";
	ifRead = "F";
	if(rows.length>0){
		ititle = rows[0].title;
		icontent = rows[0].infoContent;
		icontent = strUtil.doNull(icontent,"");
		icontent = "<div style='width:auto;height:150px;border:0px solid;margin:auto;overflow-x:auto;'>" +icontent+ "</div>";
		ifRead = rows[0].ifRead;
	}
	var tybtn = '<div class="applybtn_div"><div style="float:left">&nbsp;&nbsp;<input type="checkbox" onclick="javascript:ckBoxXz(this,\''+btntongyi+'\',\''+ifRead+'\');" checked/>已阅读报名须知 </div><a id="btntongyi" style="margin-right:110px;" onclick="submitTo2(\''+ifRead+'\')"> 同  意 </a></div>';
	var html = "<div style='padding:10px 10px;line-height:30px;text-align:center;'><h3>"+ititle+"</h3>"+icontent+"</div>";
	return html;
}
//判断是否阅读须知
function ckBoxXz(chbo,btnId,ifRead){
		
		if($(chbo).is(':checked')){
			$("#"+btnId).show();
		}else{
			if(ifRead=='T'){
				$("#"+btnId).hide();
			}
		}
	
}
function submitTo2(ifRead){
	if(ifRead=='T'){
		//添加阅读记录
		submitReadRecord('${loginUser.userId}','${loginUser.userEname}','阅读报名须知','报名须知必读记录',"${session.sessionName}","${item.itemName}");
	}else{
		showTwoStep();
	}	
}
function showTwoStep(){
	$("#div_content_bmxz").hide();
	$("#apply_window").show();
	$("#divstep").html("第二步：登记受让意向");
}
function viewBaojiaList(){
	deleteAllRow("baojias_table");
	$.ajax({
		   type:'get',
		   url:ctx+spaceDomain+'hall/list/viewRs',
		   data:{itemId:itemId},
		   dataType:'json',
		   success: function(myData){
			   if(myData.flag=='T'){
			   var htmlData = baidu.template("baojias_html",eval(myData)); 
				 $("#baojias_table").append(htmlData);
		 	  $("#view_baojias_window").show();
			   	layer.open({
			 	   type: 1,
			 	   title: "<div id='divstep'>查看竞得结果</div>",
			 	   closeBtn: 1,
			 	   area: ['700px', '520px'],
			 	   shadeClose: true,
			 	   content:  $("#view_baojias_window") 
			 	});
			   }
		  }
	});	
}
function showPicDiv(){
	sWidth = $("#focus").width();
  	len = $("#focus ul").length;
  	var index = 0;
  	$("#focus").css("width", sWidth * (len));
  	$(".flmain_l p").click(function(){
  	      index -= 1;
          if (index == -1) { index = len - 1; }
          showPics(index);
   	})
  	$(".flmian_r p").click(function(){
     	    index += 1;
          if (index == len) { index = 0; }
          showPics(index);							  
  	})
  	
  	function showPics() {
      var nowLeft = -index * sWidth;
      $("#focus").stop(true, false).animate({ "left": nowLeft }, 1000);
	}
}
</script>